import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/view/login/Login'
import Table from '@/view/table/Table'
import qiniu from '@/components/qiniu/Upload'
import edit from '@/components/table/Edit'
import main from '@/view/main/Main'
// import MainTest from '@/view/main/MainTest'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/table',
      name: 'table',
      component: Table
    },
    {
      path: '/qiniu',
      name: 'qiniu',
      component: qiniu
    },
    {
      path: '/edit',
      name: 'edit',
      component: edit
    },
    {
      path: '/main',
      name: 'main',
      component: main,
      children: [
        {
          path: '/main/posttable',
          name: 'posttable',
          component: Table
        },
        {
          path: '/main/roletable',
          name: 'roletable',
          component: () => import(/* webpackChunkName: "about" */ '@/components/table/role/RoleTable')
        },
        {
          path: '/main/usertable',
          name: 'usertable',
          component: () => import(/* webpackChunkName: "about" */ '@/components/table/user/UserTable')
        },
        {
          path: '/main/authtable',
          name: 'authtable',
          component: () => import(/* webpackChunkName: "about" */ '@/components/table/auth/AuthTable')
        },
        {
          path: '/main/roleauthtable',
          name: 'roleauthtable',
          component: () => import(/* webpackChunkName: "about" */ '@/components/table/role/RoleAuthTable')
        }
      ]
    }
  ]
})
